if(!userinfo) {
	//location.href = 'pages/login/login.html';
	mui.openWindow({
				id: '/pages/login/login.html',
				url: '/pages/login/login.html',
				show: {
					aniShow: 'fade-in',
					duration: 300
				},
				waiting: {
					autoShow: false
				}
			});
}
var pages = ["pages/chat/index_list.html", "pages/contacts/index.html", "pages/find/find.html", "pages/user/me.html"];
var subStyle = {
	top: '45px',
	bottom: '50px',
	render : "always"//一直渲染
};
var obj = [];
for(var i = 0; i < pages.length; i++) {
	//创建多个窗口
	var sub = {
		url: pages[i],
		id: pages[i],
		styles: subStyle
	};
	obj.push(sub);
}
mui.init({
	//子页面
	subpages: obj,
	//预加载
	//preloadPages: obj,
	//侧滑关闭
	swipeBack: true, //Boolean(默认false)启用右滑关闭功能
	//监听Android手机的back、menu按键
	keyEventBind: {
		backbutton: false, //Boolean(默认true)关闭back按键监听
		menubutton: false //Boolean(默认true)关闭menu按键监听
	}
});
plus.webview.show(pages[0]);
//选项卡点击事件
var activeTab = pages[0];
mui('.mui-bar-tab').on('tap', 'a', function(e) {
	var targetTab = this.getAttribute('href');
	if(targetTab == activeTab) {
		return;
	}
	//隐藏当前;
	plus.webview.hide(activeTab);
	//显示目标选项卡
	plus.webview.show(targetTab, "fade-in", 300);
	//更改当前活跃的选项卡
	activeTab = targetTab;
});
document.querySelector('#main_popover').addEventListener('click', function() {
	mui.openWindow({
		url: 'pages/contacts/addfriend.html',
		id: 'pages/contacts/addfriend.html',
		show: {
			autoShow: true,
			aniShow: 'slide-in-right',
			duration: 100
		},
		waiting: {
			autoShow: true,
			title: 'waiting...'
		},
		extras: {}
	});
});
//plus.webview.show(pages[0]);
document.querySelector('#mainsearchbtn').addEventListener('click', function() {
	mui.openWindow({
		url: 'pages/public/search.html',
		id: 'pages/public/search.html',
		show: {
			autoShow: true,
			aniShow: 'slide-in-right',
			duration: 100
		},
		waiting: {
			autoShow: true,
			title: 'waiting...'
		},
		extras: {}
	});
});
//var userinfo = get_data('user_info');
if(userinfo){
	
}
